﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ePioneer_ep_question_type : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            CMSModel.CMSEntities dal = DAL.DBManager.GetCmsEmtity();
            Repeaterquestion_type.DataSource = dal.ePioneer_QuestionType.OrderBy(p=>p.id);
            Repeaterquestion_type.DataBind();
        }
    }

    /// <summary>
    /// 返回类型名称
    /// </summary>
    /// <param name="obj">typeid</param>
    /// <returns></returns>
    public string GetEp_question_type(object obj)
    {
        CMSModel.CMSEntities dal = DAL.DBManager.GetCmsEmtity();
        if (obj == null || obj.ToString() == "" || obj.ToString() == "0")
            return "";
        else
        {
            int pid = int.Parse(obj.ToString());
            CMSModel.ePioneer_QuestionType epqt = dal.ePioneer_QuestionType.FirstOrDefault(x => x.id == pid);
            if (epqt != null)
                return epqt.name;
            else
                return "";
        }
    }
}